package com.dimbottom.entity.rest;

import java.util.HashMap;
import java.util.Map;

public class Code {

    private static final Map<Integer, String> DefaultMessage = new HashMap<>();

    public static final int OK = 200;

    static {
        DefaultMessage.put(OK, "OK");
    }

    public static final int Invalid = 400;
    public static final int Unauthorized = 401;
    public static final int AlreadyExisted = 403;
    public static final int AlreadyDeleted = 410;

    static {
        DefaultMessage.put(Invalid, "Bad Request!");
        DefaultMessage.put(Unauthorized, "Unauthorized!");
        DefaultMessage.put(AlreadyExisted, "Resources Already Existed, Don't Submit Again!");
        DefaultMessage.put(AlreadyDeleted, "Resources Already Deleted, Don't Submit Again!");
    }

    public static String getDefaultMessage(int code) {
        return DefaultMessage.get(code);
    }
}
